package com.ithiem.dubbo.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.model.domain.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserInfoMapper extends BaseMapper<UserInfo> {
    @Select("select * from tb_user_info where id in(select black_user_id from tb_black_list where user_id = #{userId})")
    IPage<UserInfo> pageBlackList(@Param("pages") Page pages, @Param("userId") Long userId);


    /*@Select("<script>" +
            "SELECT * FROM tb_user_info where age< IFNULL(#{age},1000) and gender = IFNULL(#{gender},gender) and nickname = IFNULL(#{nickName},nickname) " +
            "and id in"+
            "<foreach item='item' index='index' collection='ids' open='(' separator=', ' close=')'>" +
            "#{item}" +
            "</foreach>" +
            "</script>")
    IPage<UserInfo> selectPageByIds(@Param("userInfoPage") Page<UserInfo> userInfoPage, @Param("age") Integer age, @Param("gender") String gender, @Param("nickName") String nickName, @Param("ids") List<Long> ids);*/
}
